<template>
	<view class="detail-page page">
		<view class="content-block">
			<view class="title">{{detail.title}}</view>
			<view class="sub-title">发布时间：{{detail.crt_time}}</view>
			<view class="article-content">
				<mp-html :content="detail.content" />
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getStatistics,
		getNewsList,
		getNewListDetail,
		addBrowseApi
	} from '@/api/api.js';
	export default {
		data() {
			return {
				id: 0,

				detail: {
					title: '',
					crt_time: '',
					content: '',
				},
				content: [],
			}
		},
		methods: {
			getNew(id) {
				getNewListDetail({
					id: this.id
				}).then((res) => {
					this.detail = res[0]
				}).catch((res) => {})
			},
			addBrowse()
			{
				addBrowseApi({newsId: this.id})
			},
			
		},
		onLoad(e) {
			this.id = e.id
			this.getNew()
			this.addBrowse()

		}
	}
</script>

<style lang="scss" scoped>
	.detail-page {
		width: 100%;
		padding-bottom: 20rpx;

		.content-block {
			background-color: #fff;
			padding: 30rpx;

			.title {
				font-size: 40rpx;
				font-weight: bold;
				margin-bottom: 30rpx;
			}

			.sub-title {
				font-size: 28rpx;
				color: #999;
				margin-bottom: 30rpx;
			}

			.article-content {
				width: 100%;

				.content-image {
					width: 100%;
					margin: 0 auto;
				}
			}

			.article-content {
				font-size: 30rpx;
				line-height: 60rpx;
			}
		}
	}
</style>
